Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

fix: eth_getTransactionByBlockNumberAndIndex and eth_getTransactionByBlockHashAndIndex to respect non-zero transaction index #3119

Merged
merged 1 commit into from
May 26, 2022

Conversation

jeffsmale90
Copy link
Contributor

@jeffsmale90 jeffsmale90 commented May 23, 2022

Previously both eth_getTransactionByBlockNumberAndIndex and eth_getTransactionByBlockHashAndIndex would incorrectly return the first transaction in the block, regardless of the value passed as index.

With this fix, any transaction can be retrieved by providing its index within the given block.

…lockHashAndIndex to allow non-zero transaction index, fixes 3118
@jeffsmale90 jeffsmale90 changed the title Fix eth_getTransactionByBlockNumberAndIndex and eth_getTransactionByBlockHashAndIndex to allow non-zero transaction index, fixes 3118 Fix eth_getTransactionByBlockNumberAndIndex and eth_getTransactionByBlockHashAndIndex to allow non-zero transaction index May 23, 2022
Copy link
Member

@davidmurdoch davidmurdoch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

This needs a PR description that can be used in release before release.

@davidmurdoch davidmurdoch changed the title Fix eth_getTransactionByBlockNumberAndIndex and eth_getTransactionByBlockHashAndIndex to allow non-zero transaction index fix: eth_getTransactionByBlockNumberAndIndex and eth_getTransactionByBlockHashAndIndex to allow non-zero transaction index May 23, 2022
@jeffsmale90
Copy link
Contributor Author

I can update this to use the newer Quantity.toNumber style that's in #2983 once one of these is accepted to merge. Fixes #3118

@jeffsmale90 jeffsmale90 changed the title fix: eth_getTransactionByBlockNumberAndIndex and eth_getTransactionByBlockHashAndIndex to allow non-zero transaction index fix: eth_getTransactionByBlockNumberAndIndex and eth_getTransactionByBlockHashAndIndex to respect non-zero transaction index May 24, 2022
Copy link
Contributor

@MicaiahReid MicaiahReid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@jeffsmale90 jeffsmale90 merged commit c4be4b7 into develop May 26, 2022
@jeffsmale90 jeffsmale90 deleted the fix/get-transaction-by-index branch May 26, 2022 01:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants